<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="{:U('Index/index')}" title="首页" class="tip-bottom"><i class="icon-home"></i> 首页</a> 
			<a href="#" class="current">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="search-form fl cf">
			<div class="sleft">
				<form autocomplete="off">
					<span class="control-group">
						<select class="form-control" style="width: 200px;" name="activity_id" id="activity_id">
							<option value="0">请选择活动</option>
							<volist name="activity_list" id="vo">
								<option value="{$vo.activity_id}">{$vo.activity_name|strip_tags}</option>
							</volist>
						</select>
					</span>
					<button class="btn btn-primary" type="button" onclick="$('form').submit()" id="search_count"><i class="icon-search icon-white"></i></button>　<img id="loading" style="display:none;" src="__IMG__/loading.gif">
					<div class="control" id="member_list" style="margin:20px 0 5px 0;"></div>
				</form>
			</div>
		</div>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-content ">
						<table id="count_table" style="display:none;" class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>普通票数量</th>
									<th>VIP票数量</th>
									<th>订单数量</th>
								</tr>
							</thead>
							<tbody id="count_content"></tbody>
						</table>
						<center id="null_table">暂无数据</center>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(function (){
	//select2
	$('select').select2();
	//员工加载
    $.ajax({ url: "{:U('ServiceStatistics/getMemberList')}", success: function(data){
    	if('' != data){
    		$('#member_list').html(data).hide().fadeIn(300);
            //初始化控件
            var IS_INIT = 1;
         	// 全选
            $(".checkbox-all").bind("click",function(){
                $(this).nextAll("div.checkbox-group").children("label").children("input").prop("checked", true);
            });
            // 反选
            $(".checkbox-opposite").bind("click",function(){
                $(this).nextAll("div.checkbox-group").children("label").children("input[type=checkbox]").each(function(e) {
                    if ($(this).is(":checked")) {
                        $(this).prop("checked", false);
                    }else{
                        $(this).prop("checked", true);
                    }
                });
            });
    	}
	}});
  	//统计
	$('form').submit(function(){
		$('#search_count').prop('disabled', true);
		$('#loading').show();
		$.post("{:U('ServiceStatistics/personalAchieve')}", $('form').serialize(), call_back, "json");
		return false;
		function call_back(data){
			if(data.status == 1){
				var html_str = '<tr>' +
					'<td class="taskStatus">' + data.info.ticket_count + '</td>' +
					'<td class="taskStatus">' + data.info.vip_count + '</td>' +
					'<td class="taskStatus">' + data.info.order_count + '</td>' +
					'</tr>';
				$('#null_table').hide();
				$('#count_table').fadeIn(300);
				$('#count_content').html(html_str);
			}else{
				tke_alert(data.info, 'alert-error', 2000);
				$('#count_table').hide();
				$('#null_table').show();
				$('#count_content').html('');
			}
			setTimeout(function(){
				$('#loading').hide();
				$('#search_count').prop('disabled', false);
			}, 1000);
		}
	});
});
//导航高亮
highlight_subnav("{:U('ServiceStatistics/personalAchieve')}");
</script>
</block>